package demo5;

public class Person implements Cloneable{
    public String name;
    public int age;

    @Override
    protected Object clone() throws CloneNotSupportedException {
      Person tmp = (Person) super.clone();
      tmp.money = (Money) this.money.clone();
      return tmp;
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
    Money money = new Money();
}
